import request from '@/plugins/request'
import { IResponseData } from '@/types/request-base'
import { json2FormData, createDownload } from '@/utils'

/**
 *  获取GUID
 * @returns
 */
export function queryId() {
  return request<IResponseData>({
    url: '/app/TaskManage/GetGuid',
    method: 'get'
  })
}

/**
 *  获取服务时间
 * @returns
 */
export function queryServerTime() {
  return request<IResponseData>({
    url: '/app/TaskManage/GetServerTime',
    method: 'get'
  })
}

/**
 *  获取字典信息 硬装验收项目性质:YZXMXZ 软装验收问题属性:RZWTSX 硬装验收问题属性:YZWTSX 检查类型:LX 软装验收项目性质:RZXMXZ
 * @returns
 */
export function queryDataDictionary() {
  return request<IResponseData>({
    url: '/app/TaskManage/GetDataDictionary',
    method: 'get'
  })
}

/**
 * 上传图片
 * @param { string } caid  验收ID
 * @param { file } file  上传文件
 * */
export function postImageUpload(data: any) {
  return request<IResponseData>({
    url: '/app/TaskManage/ImageUpload',
    method: 'POST',
    data,
    headers: {
      repeatSubmit: false
    },
    loading: true,
    message: '上传中...'
  })
}
